package com.lyy.weather.database;

import android.content.Context;
import android.util.Log;

import com.lyy.weather.bean.AirIndices;
import com.lyy.weather.bean.City;
import com.lyy.weather.bean.LifeIndices;
import com.lyy.weather.bean.WeatherDaily;
import com.lyy.weather.bean.WeatherHourly;
import com.lyy.weather.bean.WeatherTimely;

import java.util.List;

public class WeatherDataUtil {
    private DatabaseUtil dbUtil;
    private Context mContext;
    private DatabaHelper dbHelper;
    private String locationId;//当前城市/地区的编号

    private City city;
    private WeatherTimely weatherTimely;
    private List<WeatherDaily> weatherDailyList;
    private List<WeatherHourly> weatherHourlyList;
    private LifeIndices lifeIndices;
    private AirIndices airIndices;

    public WeatherDataUtil(DatabaseUtil dbUtil, String locationId) {
        this.dbUtil = dbUtil;
        this.locationId = locationId;
        city=(City)dbUtil.searchCity(locationId);
        weatherTimely=(WeatherTimely)dbUtil.searchWeatherTimely(locationId);
        Log.d("TAG", weatherTimely.toString());
        weatherDailyList=dbUtil.searchWeatherDaily(locationId);
        Log.d("TAG", weatherDailyList.toString());
        weatherHourlyList=dbUtil.searchWeatherHourly(locationId);
        Log.d("TAG", weatherHourlyList.toString());
    }


    public DatabaseUtil getDbUtil() {
        return dbUtil;
    }

    public void setDbUtil(DatabaseUtil dbUtil) {
        this.dbUtil = dbUtil;
    }

    public Context getmContext() {
        return mContext;
    }

    public void setmContext(Context mContext) {
        this.mContext = mContext;
    }

    public DatabaHelper getDbHelper() {
        return dbHelper;
    }

    public void setDbHelper(DatabaHelper dbHelper) {
        this.dbHelper = dbHelper;
    }

    public String getLocationId() {
        return locationId;
    }

    public void setLocationId(String locationId) {
        this.locationId = locationId;
    }

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public WeatherTimely getWeatherTimely() {
        return weatherTimely;
    }

    public void setWeatherTimely(WeatherTimely weatherTimely) {
        this.weatherTimely = weatherTimely;
    }

    public List<WeatherDaily> getWeatherDailyList() {
        return weatherDailyList;
    }

    public void setWeatherDailyList(List<WeatherDaily> weatherDailyList) {
        this.weatherDailyList = weatherDailyList;
    }

    public List<WeatherHourly> getWeatherHourlyList() {
        return weatherHourlyList;
    }

    public void setWeatherHourlyList(List<WeatherHourly> weatherHourlyList) {
        this.weatherHourlyList = weatherHourlyList;
    }

    public LifeIndices getLifeIndices() {
        return lifeIndices;
    }

    public void setLifeIndices(LifeIndices lifeIndices) {
        this.lifeIndices = lifeIndices;
    }

    public AirIndices getAirIndices() {
        return airIndices;
    }

    public void setAirIndices(AirIndices airIndices) {
        this.airIndices = airIndices;
    }
}
